package cn.lili.event.impl;

import cn.lili.common.security.enums.SceneEnums;
import cn.lili.event.UserRegisterEvent;
import cn.lili.modules.member.entity.dos.User;
import cn.lili.modules.payment.client.WalletClient;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 会员钱包创建
 *
 * @author Chopper
 * @since 2020-07-03 11:20
 */
@Service
@RequiredArgsConstructor
public class UserWalletExecute implements UserRegisterEvent {

    private final WalletClient walletClient;

    @Override
    public void userRegister(User member) {
//         有些情况下，会同时创建一个member_id的两条数据
        walletClient.getMemberWallet(member.getId());
    }
}
